var format = 'mm/dd/yy', base;

(function () {
    var src = 'ui.datepicker.initialize.js';
    var scripts = document.getElementsByTagName('script');
    for (var i = 0; i < scripts.length; i++) {
    if (scripts[i].src.match(src)){
        base = scripts[i].src.replace(src, '');
        break;
        }
    }
})();

$(document).ready(function(){
    $('.datepicker-container *').attachDatepicker({speed: '', dateFormat: format, showOn: 'both', buttonImage: base + 'calendar.gif', buttonImageOnly: true});
});
